<extend name="Index::index" />
<block name="table">
	<div class="agoods_nav">
		<span>商品列表</span>
	</div>
	<a href="{:U('Goods/add')}"><button style="width:100px;height:40px;border:none;background:#DC5448;">添加商品</button></a>
	<table class="table"  border="1" cellspacing="0" cellpadding="5" align="center">
		<tr>
			<th colspan="8">
				<form action="{:U('Goods/like')}"  method="get">
				<input type="text" name="like" />
				<button>搜索</button>
				</form>
			</th>
		</tr>

		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>商品名</th>
			<th>图片</th>
			<th>价格</th>
			<th>上架</th>
			<th>热销</th>
			<th>新品</th>
			<th>操作</th>
		</tr>
		<foreach name="list" item="val">
			<tr>
				<td>{$val['gid']}</td>
				<td>{$val['gname']}</td>
				<td><img src="__ROOT__{$val['giname']}" alt=""> </td>
				<td style="color:red">
				￥:{$val['gp']}
				</td>
				<td>
					<if condition="$val['gb'] eq 1">
							<a style="color:red" href="{:U('Goods/Status',['id'=>$val['gid'],'is_bast'=>$val['gb']])}">
							 上架</a>
						<else /> 
							 <a style="color:blue" href="{:U('Goods/Status',['id'=>$val['gid'],'is_bast'=>$val['gb']])}">下架</a>
					</if>
				</td>
				<td>	
					<if condition="$val['ghot'] eq 1">
							<a style="color:red" href="{:U('Goods/Status',['id'=>$val['gid'],'is_hot'=>$val['ghot']])}">
							 热销</a>
						<else /> 
							 <a style="color:blue" href="{:U('Goods/Status',['id'=>$val['gid'],'is_hot'=>$val['ghot']])}">不热销</a>
					</if>
				</td>
				<td>
					<if condition="$val['gnew'] eq 1">
							<a style="color:red" href="{:U('Goods/Status',['id'=>$val['gid'],'is_new'=>$val['gnew']])}">
							 新品</a>
						<else /> 
							 <a style="color:blue" href="{:U('Goods/Status',['id'=>$val['gid'],'is_new'=>$val['gnew']])}">非新品</a>
					</if>
				</td>
				<td><a href="{:U('Goods/deleted',['id'=>$val['gid']])}">删除</a>|<a href="{:U('Goods/more',['id'=>$val['gid']])}">查看详情</a></td>
			</tr>
		</foreach>
			<tr>
				<td colspan="8">{$page}</td>
			</tr>
	</table>
</block>
